﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%


	dim rs,sql,i,name,act,page,fleg,id,litsid,book1

    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1
		id=Request.QueryString("id")
		if not isnumeric(litsid) then id=1
		if id="" then id=1
		id=clng(id)
		act=Request.QueryString("act")
		if not isnumeric(act) then act=0
		if act="" then act=0
		act=clng(act)
		litsid=Request.form("litsid")
		if not isnumeric(litsid) then litsid=1
		if litsid="" then litsid=1
		litsid=clng(litsid)
select case v
case "0"
we0="<br/>"
hr="----------<br/>"
book="<input name=""remark"" type=""text"" maxlength=""128"" emptyok=""true"" size='15' value="""" /><br/><anchor title=""添加专题名称"">添加专题名称<go href='zuanon.asp?sid="&sidd&"' method='post'><postfield name=""name"" value=""$(remark)""/></go></anchor><br/>"
%>
<card title="论坛专题"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
book1=""&we&"<form action=""zuanon.asp?sid="&sidd&""" method=""post""><br/>"
book="<input type=""text"" name=""name"" size='15' value="""" /><input type=""submit"" value=""添加专题名称"" /></form>"&we0&""
title="<title>添加专题名称</title></head><body>"
%>
<title>论坛专题</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select

		if sid="Null" then
		%><%=dao%><%=zi%>欢迎你<%=zi0%><a href="/login.asp?sid=<%=sidd%>&amp;url=/bbs/zuanon.asp?id=<%=id%>@@litsid=<%=litsid%>">注册/登陆</a><%=we0%><%
		else
		qingtian.info
		end if
		%>
<%=qingtian.qingsav("80")%>
<%if qingtian.bbs=true then
name=qingtian.RepSQL(Request.form("name"))
if len(name)>3 then
	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "select [name],[litsid] from [qingtian_zuan]"
        Rs.Open Sql,conn,1,3
	rs.addnew
        rs("name")=name
        rs("litsid")=litsid
	rs.update
        Response.Write("添加专题成功！<br/>")
	rs.close
	set rs=nothing
end if
if act=1 then
	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "select top 1 [id] from [qingtian_zuan] where id="&id
        Rs.Open Sql,conn,1,3
	if not (rs.bof and rs.eof) then
	For i=1 to rs.RecordCount
	    If Rs.Eof Then
		exit For
	     End If
	rs.delete
	Rs.MoveNext
	Next
        else
        Response.Write("删除该专题失败！<br/>")
        end if
	rs.close
	set rs=nothing
end if
%>
<%=book1%>
	论坛分类名称：<br/>
<%
		Set Rs = Server.CreateObject("Adodb.Recordset")
		Sql = "SELECT * from qingtian_bbs where del=0 order by pid asc"
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then
		For i=1 to  rs.RecordCount
		If Rs.Eof Then
			exit For
		End If
		if i=1 then
		%>
		<select name="litsid" value="<%=rs("id")%>">
		<%
		end if
		%>
		<option value="<%=rs("id")%>"><%=qingtian.utf8(rs("name"))%></option>
		<%
	  Rs.MoveNext
	  Next
	else	
	%>
	<select name="litsid" value="">
	<%
	  end if
	  Rs.close
	  set rs=nothing
	%>
	</select><br/>
<%=book%>
<%end if%>
<%=hr%><%
	Set Rs = Server.CreateObject("Adodb.Recordset")
			Sql = "select [id],[name] from [qingtian_zuan] order by [id] asc"

		Rs.Open Sql,conn,1,3
		if not (rs.bof and rs.eof)  then
				Rs.PageSize = 15	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage


		For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
if qingtian.bbs=true then
scan=".<a href='zuanon.asp?act=1&amp;id=" & rs("id") & "&amp;page=" & Page & "&amp;sid="&sidd&"'>删除</a>"
else
scan=""
end if
dat=i+(page-1)*Rs.PageSize
dat1=dat mod 2
if dat1=0 then
%>			
<%=we%>★<a href="zuanli.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%=scan%><%=we0%>
<%
else
%>
<%=sou%>★<a href="zuanli.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%=scan%><%=we0%>
<%
End If
			
	 	Rs.MoveNext
	  	Next   
 
   		'分页
                if rs.PageCount>1 then
                    Response.Write dao
                end if
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='zuanon.asp?page=" & Page + 1 & "&amp;sid="&sidd&"'>下页</a>")
    		End If
   		If Page > 1 Then
    		    Response.Write("<a href='zuanon.asp?page=" & Page - 1 & "&amp;sid="&sidd&"'>上页</a>")
    		End If
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='zuanon.asp?page=" & rs.PageCount & "&amp;sid="&sidd&"'>末页</a>")
    		End If
    		If Page > 1 Then
    		    Response.Write("<a href='zuanon.asp?page=1&amp;sid="&sidd&"'>首页</a>"&we0&"")
    		Elseif rs.PageCount >1 then
    		    Response.Write we0
    		End If
		else
%>
<%=we%>暂无专题！<%=we0%>
<%
		end if
		Rs.close
	set rs=nothing

%><%=hr%>
<%=qingtian.qingsav("81")%>

<%
End Function
%>
